﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ApiTemplateGenerate.ModelInfo
{
    /// <summary>
    /// 类型信息
    /// </summary>
    public class TypeInfo
    {   
        /// <summary>
        /// 类型枚举
        /// </summary>
        public TypeEnum TypeEnum { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        public Type Type { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 值
        /// </summary>
        public object Value { get; set; } 
        /// <summary>
        /// 描述
        /// </summary>
        public string Describe { get; set; }
        /// <summary>
        /// 类型是泛型时候是否是T
        /// </summary>
        public bool IsT { get; set; } = false;
        /// <summary>
        /// 子类型
        /// </summary>
        public List<TypeInfo> TypeInfoChild { get; set; } = new List<TypeInfo>();
    }
    /// <summary>
    /// 类型枚举
    /// </summary>
    public enum TypeEnum
    {
        //类 Student
        Class = 1,
        //基本类型 int long string 
        BaseType = 2,
        //IEnumerable List
        IEnumerable = 3,
        //arry int[]
        IsArray = 4,
        //泛型 G<T>
        Generic = 5,
        //enum  
        Enum = 6,  
        // 可空类型 int?
        IsNullType=7,
        //其它类型
        Other = 8,
    }
}
